import config from 'config'
import httpFetch from 'share/httpFetch'

export default {
  //根据审批节点oid批量查节点名称
  getApproveNodeName(params) {
    return httpFetch.post(`${config.baseUrl}/brms/api/rule/approval/batch/node/name`, params)
  },

  //审批通过
  handleExpenseReportApprovePass(params) {
    return httpFetch.post(`${config.baseUrl}/api/approvals/pass`, params)
  },

  //审批驳回
  handleExpenseReportApproveReject(params) {
    return httpFetch.post(`${config.baseUrl}/api/approvals/reject`, params)
  },

  //是否可以加签 counterSignType：enableAddSignForSubmitter（验证提交人是否可加签，单据为编辑状态）、enableAddSign（验证审批人审批单据时是否可加签）
  isCounterSignEnable(companyOID, formOID, counterSignType, approverOID, entityOID, entityType) {
    let params = {
      companyOID, formOID, counterSignType, approverOID, entityOID, entityType
    };
    return httpFetch.post(`${config.baseUrl}/api/countersign/addSign/enable/and/scope`, params)
  },

  //批量驳回费用
  batchRejectInvoice(params){
    return httpFetch.post(`${config.baseUrl}/api/approvals/reject/expensereport/invoice`, params)
  },

  getUserAvatar(userOID){
    return httpFetch.get(`${config.baseUrl}/api/users/oids?page=0&size=1&userOIDs=${userOID}`)
  }

}
